package com.ruoyi.project.records.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.records.domain.DocterWork;
import com.ruoyi.project.records.service.IDocterWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/records/docterWork")
public class DocterWorkController extends BaseController {
    @Autowired
    private IDocterWorkService docterWorkService;

    //根据医生姓名和就诊时间动态查询医生工作量列表
    @RequestMapping("/list")
    @PreAuthorize("@ss.hasPermi('records:docterWork:list')")
    public TableDataInfo selDocterWorkList(DocterWork docterWork){
        String dName = docterWork.getdName();
        Map<String, Object> params = docterWork.getParams();
        List<DocterWork> list = docterWorkService.selDocterWorkList(dName,params);
        return getDataTable(list);
    }

    //根据医生姓名和接诊时间动态查询总体工作量情况
    @RequestMapping("/sum")
    @PreAuthorize("@ss.hasPermi('records:docterWork:sum')")
    public TableDataInfo selDocterWorkSum(DocterWork docterWork){
        String dName = docterWork.getdName();
        Map<String, Object> params = docterWork.getParams();
        List<DocterWork> docterWorks = docterWorkService.selDocterWorkSum(dName,params);
        return getDataTable(docterWorks);


    }
}
